package utils;

/**
 * @author Allen_HJL
 * @version 1.0
 * @date 2020/9/13 9:28
 */
public enum ResultCode{
    /* 成功状态码 */
    SUCCESS(1,"成功"),
    LOGIN_SUCCESS(2,"登录成功"),
    ANSWER_WRONG(3,"回答错误"),
    ANSWER_RIGHT(4,"回答正确"),
    /* 参数错误 */
//    PARAM_IS_INVALID(1001,"参数无效"),
//    PARAM_IS_BLANK(1002,"参数为空"),
//    PARAM_TYPE_BIND_ERROR(1003,"参数类型错误"),
//    PARAM_NOT_COMPLETE(1004,"参数缺失"),
    /* 用户错误 2001-2099*/
    USER_NOT_LOGGED_IN(2001,"用户未登录，访问的路径需要验证，请登录"),
    USER_LOGIN_ERROR(2002,"账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003,"账号已被禁用"),
    USER_NOT_EXIST(2004,"用户不存在"),
    USER_HAS_EXISTED(2005,"用户已存在"),
    USER_NOAUTHORIZED(2006,"未授权"),
    USER_REGISTER_SUCCESS(2007,"注册成功"),
    /* 验证码错误 3001*/
    CODE_ERROR(3001,"验证码不正确"),
    MAIL_CODE_SUCCESS(3002,"邮箱验证码发送成功"),
    MAIL_CODE_ERROR(3003,"邮箱验证码发送失败"),
    MAIL_CODE_COMPARE_SUCCESS(3004,"邮箱验证码比对成功"),
    MAIL_CODE_COMPARE_ERROR(3005,"邮箱验证码比对失败"),
    MAIL_CODE_EXPIRE(3006,"邮箱验证码已过期"),
    /* 操作结果 4001-4099*/

    ADD_DATA_SUCCESS(4001,"添加单条数据成功"),
    ADD_MANYDATA_SUCCESS(4002,"添加多条条数据成功"),
    ADD_DATA_FAILURE(4003,"添加单条数据失败"),
    ADD_MANYDATA_FAILURE(4004,"添加多条条数据失败"),

    DELETE_DATA_SUCCESS(4005,"删除单条数据成功"),
    DELETE_MANYDATA_SUCCESS(4006,"删除多条条数据成功"),
    DELETE_DATA_FAILURE(4007,"删除单条数据失败"),
    DELETE_MANYDATA_FAILURE(4008,"删除多条条数据失败"),

    FIND_DATA_SUCCESS(4009,"查找单条数据成功"),
    FIND_MANYDATA_SUCCESS(4010,"查找多条条数据成功"),
    FIND_DATA_FAILURE(4011,"查找单条数据失败"),
    FIND_MANYDATA_FAILURE(40012,"查找多条条数据失败"),

    UPDATE_DATA_SUCCESS(4009,"更新单条数据成功"),
    UPDATE_MANYDATA_SUCCESS(4010,"更新多条条数据成功"),
    UPDATE_DATA_FAILURE(4011,"更新单条数据失败"),
    UPDATE_MANYDATA_FAILURE(40012,"更新多条条数据失败");
    private Integer code;
    private String message;
    ResultCode(Integer code,String message){
        this.code=code;
        this.message=message;
    }
    public Integer code(){
        return this.code;
    }
    public String message(){
        return this.message;
    }


}
